<!--
 * @Descripttion: 打印按钮
-->

<template>
	<div class="sc-button">
		<el-button type="success" plain v-auth="auth" @click="batch_import" :size="size">{{title}}</el-button>
	</div>
	<export-all v-if="check" ref="checkDialog" @success="handleSuccessCheck" @closed="check = false" :apiObj="apiObj" :base="base" draggable></export-all>
</template>

<script>

import exportAll from "./exportAll.vue";

export default {
	components: { exportAll },
	props: {
		apiObj: { type: Object, default: () => { } },
		auth: { type: String, default: '' },
		base: { type: String, default: '' },
		size: { type: String, default: '' },
		title: { type: String, default: '导入'},
	},
	data() {
		return {
			check: false,
		}
	},
	created() {

	},
	methods: {
		/**审核成功事件*/
		handleSuccessCheck(data) {
			this.$emit('importSuccess', data)
		},
		/**审核*/
		async batch_import() {
			this.check = true
			this.$nextTick(() => {
				this.$refs.checkDialog.open('add')
			})
		},
	}
}
</script>

<style scoped>
.sc-button {
	margin-left: 12px;
	display: flex;
}
</style>
